<?php if($id!=0){ 
$key = $form_view_config['key'];
?>
<script type="text/javascript" src="<?=PATH_URL.'static/js/admin/uploader/plupload.js'?>"></script>
<script type="text/javascript" src="<?=PATH_URL.'static/js/admin/uploader/plupload.html5.js'?>"></script>
<script type="text/javascript" src="<?=PATH_URL.'static/js/admin/uploader/plupload.html4.js'?>"></script>
<script type="text/javascript" src="<?=PATH_URL.'static/js/admin/uploader/jquery.plupload.queue.js'?>"></script>
<script type="text/javascript">
$(document).ready(function(){
	//===== File uploader =====//
	$("#uploader").pluploadQueue({
		runtimes: 'html5,html4',
		url: root+'admincp/'+module+'/uploader/<?=$id?>/<?=$key?>',
		max_file_size: '2mb',
		unique_names: true,
		filters: [
			{title : "Image files", extensions : "jpg,gif,png"}
		]
	});
});

function list_image(){
	$.get(root+"admincp/"+module+"/list_image_of_gallery/<?=$id?>/<?=$key?>", function(data) {
		$('#list_image_of_gallery').html(data);
		$('.fancyboxClick').fancybox();
	});
}

function delImage(id){
	if (confirm("Are you sure you want to delete Image?")) {
		$.post(root+"admincp/"+module+"/deleteImageGallery/<?=$key?>",{
			id: id
		},function(data){
			list_image();
		});
	}
}

list_image();
</script>
 
 
<div class="row_text_field">
	<table cellspacing="0" cellpadding="0" border="0" width="100%">
		<tr>
			<td class="left_text_field"><?=$form_view_config['text']?>:</td>
			<td class="right_text_field" style="padding-right: 0;"><div id="uploader">You browser doesn't have HTML 4 support.</div></td>
		</tr>
	</table>
</div>

<div class="row_text_field" id="gr_list_image">
	<table cellspacing="0" cellpadding="0" border="0" width="100%">
		<tr>
			<td class="left_text_field" style="padding-top: 10px;">List image of Gallery:</td>
			<td class="right_text_field" style="padding-right: 0;" id="list_image_of_gallery"></td>
		</tr>
	</table>
</div>
<?php } ?>